﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Homework11
{
    //作业11:接收4个学员的3门课成绩，并输出每个学员的总成绩及平均成绩
    internal class Homework11
    {
        static void Main(string[] args)
        {
            //定义数组
            int[,] arr = new int[4,3];
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                int sum = 0;
                for (int j = 0; j < arr.GetLength(1); j++)
                {
                    Console.Write($"请输入第{j+1}课的成绩:");
                    arr[i,j] = Convert.ToInt32(Console.ReadLine());
                    sum += arr[i, j];
                }
                Console.WriteLine($"第{i+1}个学生的总成绩是:{sum}, 平均成绩是:{sum/ arr.GetLength(1)}");
            }
            Console.Write("循环结束");
        }
    }
}
